package NGUYENXUANTUNG.OOP.BAITAPTRENLOP1;

public class MODELS {
	public double PTbac2(double a, double b, double c){
		double delta;
		double result = 0;
		delta = b*b - 4*a*c;
		
		if ( delta < 0){
			System.out.println("PT vo nghiem");
		}
		else if ( delta == 0){
			System.out.println("PT co nghiem kep x = " + (-b/2*a));
		}
		else {
			System.out.println("x1 = " + ((-b + Math.sqrt(delta))/2*a));
			System.out.println("x2 = " + ((-b - Math.sqrt(delta))/2*a));
		}
		return result;
	}

}
